<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>面对对象编程class继承</title>
</head>
<script>
    class Student{
        constructor(name){
            this.name = name;
        }
        hello(){
            alert('hello');
        }
    }
    var xiaoming = new Student("xiaoming");
    var xiaohong = new Student("xiaohong");
</script>
<body>

</body>
</html>